package org.zhu.controller;

import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zhu.service.YoutuService;

import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;

/**
 * Created by yingzhi zhu on 2017/10/16.
 */
@RestController
public class IndexController {

    @Autowired
    private YoutuService youtuService;

    @GetMapping("delectFace")
    public String delectFace() throws IOException, NoSuchAlgorithmException, JSONException, KeyManagementException {
        return youtuService.delectFace();
    }

    @GetMapping("createPerson")
    public String createPerson() throws IOException, NoSuchAlgorithmException, JSONException, KeyManagementException {
        return youtuService.createPerson();
    }

    @GetMapping("addFace")
    public String addFace() throws IOException, NoSuchAlgorithmException, JSONException, KeyManagementException {
        return youtuService.addFace();
    }

    @GetMapping("faceidentify")
    public String faceidentify() throws IOException, NoSuchAlgorithmException, JSONException, KeyManagementException {
        return youtuService.faceidentify();
    }

    @GetMapping("getgroupids")
    public String getgroupids() throws IOException, NoSuchAlgorithmException, JSONException, KeyManagementException {
        return youtuService.getgroupids();
    }
}
